<script setup>
defineProps({
  examples: Array,
  currentExample: Object
});

defineEmits(['select']);
</script>

<template>
  <div class="tabs-container">
    <div class="tabs">
      <button
          v-for="example in examples"
          :key="example.id"
          @click="$emit('select', example)"
          :class="['tab', { active: currentExample.id === example.id }]"
      >
        {{ example.title }}
      </button>
    </div>
  </div>
</template>

<style scoped>
.tabs-container {
  width: 300px;
  background-color: rgba(255, 255, 255, 0.08);
}

.tab {
  display: block;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  margin: 0 auto 4px auto;
  color: #ddd;
  padding: 5px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 0.95rem;
  width: 280px;
  text-align: left;
}

.tab:hover {
  background: rgba(0, 150, 255, 0.3);
  transform: translateY(-3px);
}

.tab.active {
  background-color: #00c9ff;
  box-shadow: 0 5px 15px rgba(0, 201, 255, 0.4);
}
</style>